<?php
/**
 * <https://y.st./>
 * Copyright © 2016 Alex Yst <mailto:copyright@y.st>
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <https://www.gnu.org./licenses/>.
**/

$xhtml = array(
	'title' => 'Is the oom-killer the problem?',
	'body' => <<<END
<p>
	I tracked down the issue with the spider.
	The <a href="https://secure.php.net/manual/en/function.xml-parse-into-struct.php"><code>\\xml_parse_into_struct()</code> function</a> is supposed to return 0 on failure and 1 on success, but instead, the script simply terminates upon calling that function.
	Someone on $a[IRC] explained that the likely cause was oom-killer, some sort of daemon that kills processes that take too much memory.
	They also explained that when parsing data, three to five times the file&apos;s size is needed in $a[RAM].
	However, while this explanation seems exceedingly likely, I cannot find any trace of this happening in the logs.
	Additionally, when I set the file download size limit to four megabytes, the spider still ended up dead.
	Because Web servers can lie about file content types, I want to solve this issue without relying on <code>Content-Type</code> headers, though after I have done so, I want to additionally start taking <code>Content-Type</code> headers into account.
	I think that by modifying my <code>curl_limit</code> class, I can check the <code>Content-Type</code> header before the download has finished.
	I think that I want to make the class a bit more complex, both giving it the option to abort a download based on the <code>Content-Type</code> header and giving it a way to communicate error messages (such as the fact that it had to abort a download and why) to other parts of a script that uses it.
	The name <code>curl_limit</code> will either need to be changed or it will become a artifact title.
</p>
<p>
	I spent most of the day sorting $a[VHS] cassettes at the local library in an effort to help Cyrus with his Boy Scout project.
	We took any cassette off the shelf if it had not been checked out in over a year so that they can be removed from the inventory and sold.
	It was mostly uneventful, though the librarian was very happy with our work.
	We have not finished though, so we will be back in tomorrow.
</p>
<p>
	Alyssa will be coming to town tonight, though she had not arrived yet at the time that I had written my weblog entry.
	She will also be helping with the Boy Scout project to move progress along.
</p>
<p>
	My <a href="/a/canary.txt">canary</a> still sings the tune of freedom and transparency.
</p>
END
);
